﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MutiCodecO.codeclib
{
    class Base642Asii : ICodec
    {
        public String parse(String strInput)
        {
            return Encoding.Default.GetString(Convert.FromBase64String(strInput));
        }

        public String parse(String strInput, String prefix, String partion)
        {
            String s = Encoding.Default.GetString(Convert.FromBase64String(strInput));
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < s.Length; i++)
            {
                sb.Append(prefix);
                sb.Append(s[i]);
                if (i != s.Length - 1)
                    sb.Append(partion);
            }
            return sb.ToString();
        }
    }
}
